﻿using UnityEngine;
using System.Collections;

public class Loading_Control : ModuleComponent<Loading_Control>,ILoading_Control{
	Loading_View view;
	public void Open(){
		view = ViewUIMgr.Instance.ShowViewUI<Loading_View>(ViewUIPanelDepth.Top,"Base");
		view.Open ();
		SetValue (1);
	}
	public void BtnLoadScene(GameObject target){
		BaseControl.Instance.LoadScene ("main");
	}
	public void SetValue(float value){
		view.SetValue (value);
	}
//	public void Update(){
//		if (view.GetSliderValue () >= 1) {
//			Close();
//		}
//	}
	public void Close(){
		Debug.Log ("close me");
		view.ControlCallClose ();
		GameObject.Destroy (this);
	}
}
